package com.zhang.hui.one.mvvm2.ui;

import android.databinding.DataBindingUtil;
import android.databinding.ViewDataBinding;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;

import com.zhang.hui.one.BR;
import com.zhang.hui.one.R;
import com.zhang.hui.one.mvvm2.model.User;

public class MvvmActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
//        setContentView(R.layout.activity_mvvm2);
        ViewDataBinding binding = DataBindingUtil.setContentView(this, R.layout.activity_mvvm2);
        User user = new User();
        user.address = "安徽省蚌埠市怀远县双桥镇";
        user.name = "张辉";
        binding.setVariable(BR.user, user);
    }
}
